package com.serial.activity;

import android.os.Handler;
import android.os.Message;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

import com.serial.socket.WsManager;

import java.util.Date;

public class AdminActivity extends AppCompatActivity {

    private Handler handler = new Handler(){
        @Override
        public void handleMessage(Message msg) {
            super.handleMessage(msg);

        }
    };

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_admin);
        WsManager.getInstance().init();
        byte [] aa =new byte[]{0x01,0x03,0x04,0x05,(byte)0xff,0x55};
        Date date = new Date();
        while ((new Date().getTime())-date.getTime()<4000){

        }
        WsManager.getInstance().sendData(new String(aa));

    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        WsManager.getInstance().disConnect();
    }
}
